package smashedapples.mvc
{
	import mx.core.WindowedApplication;

	[Style( name="controller", type = "Class" )]

	public class AirApp extends WindowedApplication
	{
		public function AirApp()
		{
			super();
		}

		private var $controller:ApplicationController;

		private var isInitialized:Boolean = false;

		public var mvc:Class;

		override protected function commitProperties():void
		{
			super.commitProperties();
			if( mvc !== null && isInitialized == false )
			{
				mvc[ "view" ] = this;
				this.isInitialized = true;

				var ControllerClass:Class = this.getStyle( "controller" );
				if( ControllerClass != null )
				{
					this.$controller = new ControllerClass();
				}
			}
		}


		protected function moveApp():void
		{
			this.stage.nativeWindow.startMove();
		}




	}
}